﻿using CommunityToolkit.Mvvm.ComponentModel;
using GameView.Comment;
using System.ComponentModel.DataAnnotations;

namespace GameView.Services.Dtos.ConsumProduct
{
    public partial class ConProQueryDto : ObservableValidator
    {
        /// <summary>
        /// 货币类别  金币 元宝 灵符 泡点 金刚石
        /// </summary>
        [ObservableProperty]
        private string _currencytype;

        /// <summary>
        /// 操作类别  0消耗1产出
        /// </summary>
        [ObservableProperty]
        private uint? _type;

        /// <summary>
        /// 行会名称
        /// </summary>
        [ObservableProperty]
        private string _guildname;

        /// <summary>
        /// NPC名称
        /// </summary>
        [ObservableProperty]
        private string _npcname;

        /// <summary>
        /// 项目名称
        /// </summary>
        [ObservableProperty]
        private string _projectName;

        /// <summary>
        /// 游戏名称
        /// </summary>
        [ObservableProperty]
        private string _gameName;

        /// <summary>
        /// 角色名称
        /// </summary>
        [ObservableProperty]
        private string _characterName;

        /// <summary>
        /// 开始时间
        /// </summary>
        public string StartTime => StartTimeDT.ReBuildTIme(StartTime24);

        /// <summary>
        /// 结束时间
        /// </summary>
        public string EndTime => EndTimeDT.ReBuildTIme(EndTime24);

        /// <summary>
        /// 开始时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(StartTime))]
        private string _startTimeDT = DateTime.Now.ToStringFormatShort();

        /// <summary>
        /// 结束时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(EndTime))]
        private string _endTimeDT = DateTime.Now.ToStringFormatShort();

        /// <summary>
        /// 开始时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(StartTime))]
        private string _startTime24 = "00:00";

        /// <summary>
        /// 结束时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(EndTime))]
        private string _endTime24 = "23:59";

        /// <summary>
        /// 当前页
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页行数
        /// </summary>
        public int PageSize { get; set; } = 20;
    }
}